package org.xlab.dictionary.test.dao;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;
import org.springframework.test.context.support.GenericXmlContextLoader;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;
import org.xlab.dictionary.dao.postgresql.TypeDao;
import org.xlab.dictionary.domain.Type;

@ContextConfiguration(locations = { "classpath:application-context.xml" }, loader = GenericXmlContextLoader.class)
@TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = true)
@Transactional
public class TypeDaoTestCase extends AbstractTransactionalJUnit4SpringContextTests {

	@Autowired
	private TypeDao typeDao;

	@Test
	public void testCreate() throws Exception {
		Type entity = new Type();
		getTypeDao().create(entity);
	}

	protected TypeDao getTypeDao() {
		return typeDao;
	}

	protected void setTypeDao(TypeDao typeDao) {
		this.typeDao = typeDao;
	}

}
